JavaScript

listObj.getCheckedValues Method

Syntax

result = listObj.getCheckedValues()

Returns

resultarray

Returns an array of values for the rows that were checked. If no rows are checked, returns an empty array.

Description

Returns an array of values for the rows that were checked.

Discussion

The getCheckedValues() List object method returns an array that contains the values for checked rows in the List. The returned value is the value specified in the List's Return value settings. If the List is not configured to return a specific value, such as the Primary Key field for a row, the getCheckedValues() method will return all of the data of the checked row.

Example

var listObj = {dialog.object}.getControl('LIST1');

if (listObj) {
    var values = listObj.getCheckedValues();
    var msg = "";
    for (var i = 0; i < values.length; i++) {
        msg = msg+"values["+i+"] = "+values[i]+"<br>";
    }

    A5.msgBox.show("Selected Values",msg,"o");
}
This method is only available if Has check-box select control has been enabled.

Limitations

List Control with 'Has check-box select control' Enabled

See Also